# Please install OpenAI SDK first: `pip3 install openai`

from openai import OpenAI

# 1.创建一个OpenAI客户端对象
client = OpenAI(
    api_key="sk-942e904b9f1c45a1976e82a534eccbf7",  # deepseek API 密钥
    base_url="https://api.deepseek.com/v1"  # 默认为 https://api.deepseek.com/v1
)
# 2.创建一个聊天会话
response = client.chat.completions.create(
    # deepseek-chat--- 聊天模型--V3.1
    # deepseek-reasoner---- 理解模型--R1,
    model="deepseek-reasoner",  # 模型名称
    messages=[  # 聊天内容
        {"role": "system", "content": "我是一个AI智能助手，我可以帮助你解决各种问题。"},
        {"role": "user", "content": "你是什么大模型"},
    ],
    stream=False  # 是否流式返回结果
)

# 3.输出结果
# print(response)
print("输出结果:", response.choices[0].message.content)  # 输出结果
print("推理结果:", response.choices[0].message.reasoning_content)  # 输出结果
